<?php
declare (strict_types=1);
namespace app\serviceapp;

use app\model\FenggeParam;
use app\model\Matchmaker;
use app\model\User;
use app\model\UserDetails;
use app\model\UserFavorite;
use app\MyException;
use app\traits\ServiceTrait;
use app\util\JwtUtil;
use app\service\AuthGroupService;
use app\model\ReportDic;

/**
 * 设计师
 * Class MatchmakerService
 * @package app\service
 */
class MatchmakerService
{

    /**
     * 通过ID获取设计师信息
     * $makerId 设计师ID
     */
    public static function getMatchmakerById($makerId)
    {
        if (!$makerId)  throw new MyException(10002);
        $oneMaker = Matchmaker::where('shejishi_id = :shejishi_id', ['shejishi_id' => $makerId])->find();
        if (!$oneMaker) {
            throw new MyException(10004);
        }

        return $oneMaker->toArray();
    }

    /**
     * 获取一个设计师信息
     */
    public static function getMatchmakerInfo()
    {
        $oneMaker = Matchmaker::find(1);
        if (!$oneMaker) {
            throw new MyException(10004);
        }

        return $oneMaker->toArray();
    }

}
